/**
 * 
 */
package com.googlecode.agiletools.backlog;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.CollectionOfElements;
import org.hibernate.annotations.IndexColumn;

import com.googlecode.agiletools.pair.Pair;
import com.googlecode.agiletools.type.BaseObject;

/**
 * @author Administrator
 * 
 */
@Entity
@Table(name = "agiletools_sprinttask")
public class SprintTask extends BaseObject {

    private static final long serialVersionUID = 1494997287957194745L;

    private String code;

    private String headline;

    private String detail;

    private Pair pair;

    private SprintBacklog backlog;

    private List<Float> leftEfforts;

    private int seq;

    /**
     * @return the backlog
     */
    @ManyToOne
    @JoinColumn(name = "backlogId", nullable = false)
    public SprintBacklog getBacklog() {
	return backlog;
    }

    /**
     * The code of the task. Could be story id of bug id.
     * 
     * @return the code
     */
    public String getCode() {
	return code;
    }

    /**
     * @return the detail
     */
    @Lob
    public String getDetail() {
	return detail;
    }

    /**
     * @return the headline
     */
    public String getHeadline() {
	return headline;
    }

    /**
     * @return the leftEfforts
     */
    @CollectionOfElements
    @JoinTable(name = "agiletools_sprinttask_leftefforts", joinColumns = @JoinColumn(name = "sprintTaskId"))
    @Column(name = "leftEffort", nullable = true)
    @IndexColumn(name = "seq", nullable = false)
    public List<Float> getLeftEfforts() {
	return leftEfforts;
    }

    /**
     * @return the pair
     */
    public Pair getPair() {
	return pair;
    }

    /**
     * @return the seq
     */
    public int getSeq() {
	return seq;
    }

    /**
     * @param backlog
     *            the backlog to set
     */
    public void setBacklog(SprintBacklog backlog) {
	this.backlog = backlog;
    }

    /**
     * @param code
     *            the code to set
     */
    public void setCode(String code) {
	this.code = code;
    }

    /**
     * @param detail
     *            the detail to set
     */
    public void setDetail(String detail) {
	this.detail = detail;
    }

    /**
     * @param headline
     *            the headline to set
     */
    public void setHeadline(String headline) {
	this.headline = headline;
    }

    /**
     * @param leftEfforts
     *            the leftEfforts to set
     */
    public void setLeftEfforts(List<Float> leftEfforts) {
	this.leftEfforts = leftEfforts;
    }

    /**
     * @param pair
     *            the pair to set
     */
    public void setPair(Pair pair) {
	this.pair = pair;
    }

    /**
     * @param seq
     *            the seq to set
     */
    public void setSeq(int seq) {
	this.seq = seq;
    }

}
